package com.andlabs.gd.communication;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;

import com.andlabs.gd.map.GameMap;
import com.andlabs.gd.objects.Building;

/**
 * @author johannes
 */
public class CommunicatorMock implements Runnable{

	//======================
	// Fields
	//======================
	private GameMap map = new GameMap();
	private CommunicationListener mListener;
	public boolean communicate = true;
	//======================
	// Constructors
	//======================
	public  CommunicatorMock() {
		Thread thread = new Thread(this, "Game Development Tutorial Communication Thread");
		thread.start();
	}
	//======================
	// Overridden Methods
	//======================
	@Override
	public void run() {
		while(communicate){
			if(mListener != null){
				//Server communication here!!
				mListener.setMap(map);
			}
			
			try{
				Thread.sleep(30000);
			}catch(InterruptedException e){
				//Argh!
			}
		}
	}
	
	//======================
	// Public Methods
	//======================
	public void setCommunicationListener(CommunicationListener listener){
		mListener = listener;
	}
	
	public void action(int type, float x, float y) {
	}

	public void build(Building building) {
	}	

	//======================
	// Private Methods
	//======================
}

